package transaction.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * @author： pang-yun
 * @date： 2021-12-03 10:09
 * 功能目的 ：用于
 */
@Repository
public class UserDaoImpl implements UserDao{

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public void increase() {
        String sql="update account set money=money+? where username=?";
        jdbcTemplate.update(sql,100,"left");
    }

    @Override
    public void reduce() {
        String sql ="update account set money=money-? where username=?";
        jdbcTemplate.update(sql,100,"right");
    }
}
